//
//  ByShapeBgView.m
//  laserdevice_ios
//
//  Created by pro on 17/1/2.
//  Copyright © 2017年 com.itboye. All rights reserved.
//

#import "ByShapeBgView.h"

@implementation ByShapeBgView


- (instancetype)initWithFrame:(CGRect)frame {
    
    if (self = [super initWithFrame:frame]) {
        CGFloat width = frame.size.width;
        CGFloat height = frame.size.height;
        
        UIBezierPath *path = [UIBezierPath bezierPath];
        for (int i = 0; i <= width; i += 2) {
            [path moveToPoint:CGPointMake(i, 0)];
            [path addLineToPoint:CGPointMake(i, height)];
        }
        for (int j = 0; j <= height; j ++) {
            [path moveToPoint:CGPointMake(0, j)];
            [path addLineToPoint:CGPointMake(width, j)];
        }
        
        self.shapeLayer.strokeColor = CJ_THEME_COLOR.CGColor;
        self.shapeLayer.lineWidth = 0.5;
        self.shapeLayer.path = path.CGPath;
        self.backgroundColor = [UIColor clearColor];
        self.opaque = NO;
        self.translatesAutoresizingMaskIntoConstraints = NO;


    }
    return self;
}


@end
